<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       /*  var money = prompt('请输入你要的操作:\n1.存钱\n2.取钱\n3.显示余额\n4.退出');
        var sum = 100;
        while(money == '存钱' || money == '取钱' || money == '退出'|| money == '余额'){
            if(money != '存钱'){
                if(money != '取钱'){  
                        if (money != '余额'){
                            if(money == '退出'){
                            alert('已退出');
                            break;
                            }
                        }else{
                            alert('余额' + sum);
                        }
                    }else{
                        var num = +prompt('请输入要取的金额')
                        sum = sum - num;
                        alert('你的余额是' + sum);
                }
                }else{
                    var num = +prompt('请输入要存的金额')
                    sum = sum + num;
                    alert('你的余额是' + sum);
                }
                 money = prompt('请输入你要的操作:\n1.存钱\n2.取钱\n3.显示余额\n4.退出');
        } */

        var money = +prompt('请输入你要的操作:\n1.存钱\n2.取钱\n3.显示余额\n4.退出');
        var sum = 100;
        while(money != 4){
            switch (money){
                case 1:
                    var num = +prompt('请输入要存的金额');
                    sum = sum + num;
                    alert('你的余额是' + sum);                    
                break;
                case 2:
                    num = +prompt('请输入要取的金额');
                    sum = sum - num;
                    alert('你的余额是' + sum);
                break;
                case 3:
                    alert('你的余额是' + sum);
                break;
                default:
                    alert('你输入错误');
                    break;
            }
            var money = +prompt('请输入你要的操作:\n1.存钱\n2.取钱\n3.显示余额\n4.退出');
        }
        alert('已退出');
    </script>
</body>
</html>